package com.fzy.designpattern.mediator;

import java.util.HashMap;
import java.util.Map;

public class Leader implements Mediator {

    private Map<String ,Department> map = new HashMap<>();


    @Override
    public void register(String dname, Department department) {
        map.put(dname, department);
    }

    @Override
    public void command(String dename) {
        if (map.get(dename) != null) {
            map.get(dename).needToDo();
        }

    }

}
